<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>ngrok服务器搭建 | ITTUN</title>
    <meta name="keywords" content="搭建ngrok服务器"/>
    <meta name="description" content="自编译ngrok服务器,ngrok搭建教程,自搭ngrok,ittun搭建ngrok教程"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.min.css">
    <link rel="stylesheet" type="text/css" href="css/ittun-ngrok.css">
    <script type="text/javascript" src="js/lazyload.min.js"></script>
</head>
<body>

<div id="nav">
    <div class="container-fluid">
        <div class="masthead">
            <ul class="nav nav-pills pull-right">
                <!--<li class="active">-->
                <!--<a href="#">Home</a>-->
                <!--</li>-->

                <!--<li class="active">-->
                <!--<a href="http://bbs.ittun.com" style="background-color: #89d7b3">-->
                <!--交流圈-->
                <!--</a>-->
                <!--</li>-->

            </ul>
            <h3 class="wordmark muted"><a href="#">NGrok服务器搭建</a>
                <a href="index.html" style="float: right">IT TUN</a>
            </h3>
        </div>
    </div>
</div>

<div class="container-fluid">
      <pre>
         一: 准备工作:
              1. 域名一个
              2. 带公网ip服务器(linux64)
          提示:未备案域名只能用国外服务器
      </pre>
    <a href="https://help.aliyun.com/knowledge_detail/37048.html" target="_blank" style="color: blue">购买服务器的朋友关注拉,阿里云服务器9折推荐码：J1RB5Z</a><br>
    <a href="https://www.diyvm.com/page.aspx?c=referral&u=61743" target="_blank" style="color: blue">香港服务器2M 50元每月</a>
</div>


<div class="container-fluid">
    <pre>
        二.域名解析配置
         例如: 用域名的i.domain.com 作ngrok地址
               则可以配置 i及其子域名的解析地址
    </pre>
    <!--<img src="images/demo.jpg">-->
    <img src=
         data-src=images/server/domain.jpg
         onload=lzld(this)>

    <div class="row-fluid">
    <pre>
        扩展.服务端共享计划:
             如果你愿意分享给他们使用,加入共享计划吧,我们将会分享给更多需要人使用
        <div style="margin-left: 10px;margin-left: 100px;" id="shareDiv">
            <form id="applyForm">
                服务器地址(类似 ittun.com:44433):
                <input type="text" placeholder="xx.xx:port" name="serverAddr">
                <select name="share">
                    <option value="1">共享</option>
                    <option value="0">不共享</option>
                </select>
                <button type="button" class="btn btn-success" style="margin-left: 165px" id="applySubmit">提交</button>
            </form>
        </div>

        三.<a href="upload/17.4/server.zip">服务端文件下载(点击下载)</a>
        启动命令例子:
         ./ngrokd -domain="ittun.com" -httpAddr=":80" -httpsAddr=":443" -tunnelAddr=":44433"
    </pre>
    </div>
    <!--<img src="images/webhooks.jpg">-->
    <!--<img src=-->
    <!--data-src=images/webhooks.jpg-->
    <!--onload=lzld(this)>-->

    <hr>

    <div class="container-fluid">
        <div class="row-fluid">
            <p>安装方便: 下载、解压、修改二级域名与端口、启动.</p>
            <h4><a href="#" target="_blank">Step 1: 客户端文件</a></h4>
            <table id="17.3" class="table download-table">
                <tbody>
                <tr class="dl-windows-64" class="detected">
                    <th>Windows64</th>
                    <td>
                <span class="pull-right">
                    <a href="upload/17.4/win64.zip" class="btn btn-success">
                        <i class="icon-white icon-download"></i> Download
                    </a>
                </span>
                    </td>
                </tr>
                <tr class="dl-windows-386">
                    <th>Windows32</th>
                    <td>
                <span class="pull-right">
                    <a href="upload/17.4/win32.zip" class="btn btn-success">
                        <i class="icon-white icon-download"></i> Download
                    </a>
                </span>
                    </td>
                </tr>
                <tr class="dl-linux-amd64">
                    <th>Linux-amd64</th>
                    <td>
                <span class="pull-right">
                    <a href="upload/17.4/linux64.zip" class="btn btn-inverse">
                        <i class="icon-white icon-download"></i> Download
                    </a>
                </span>
                    </td>
                </tr>
                <tr class="dl-linux-i386">
                    <th>Linux-i386(32)</th>
                    <td>
                <span class="pull-right">
                    <a href="upload/17.4/linux32.zip" class="btn btn-inverse">
                        <i class="icon-white icon-download"></i> Download
                    </a>
                </span>
                    </td>
                </tr>

                <tr class="dl-linux-mac">
                    <th>Mac(支持sierra)</th>
                    <td>
                <span class="pull-right">
                <a href="upload/17.4/mac.zip" class="btn btn-inverse">
                    <i class="icon-white icon-download"></i> Download
                </a>
                </span>
                    </td>
                </tr>

                <tr class="dl-linux-arm">
                    <th>Linux-arm</th>
                    <td>
                <span class="pull-right">
                <a href="upload/17.4/linxuarm.zip" class="btn btn-inverse">
                    <i class="icon-white icon-download"></i> Download
                </a>
                </span>
                    </td>
                </tr>
                </tbody>
            </table>

            <h4>Step 2: 解压客户端文件</h4>
            <code class="well">
                unzip xxx.zip
            </code>

            <h4>Step 3: 修改config 服务器地址与端口</h4>
            <code class="well">
                客户端默认加载目录下的config.yml <br>
                修改server_addr: "服务器域名:端口"
            </code>

            <h4>Step 4: 默认启动</h4>
            <code class="well">
                linux: ./ngrok 端口 <br>
                windowns: > ngrok 端口
            </code>

            <h4>Step 5: 固定二级域名与自有域名指定</h4>
            <code class="well">
                ./ngrok -subdomain 二级域名 端口 <br>
                ./ngrok -hostname 自有域名 端口<br>

                更多 ./ngrok -help
            </code>
        </div>
    </div>
    <hr>
</div>

<div id="footer">
    <div class="container-fluid">
        © <a href="#">ittun.com</a> 2015 © <a href="http://www.miitbeian.gov.cn">粤ICP备15099276号</a>

        <div class="row-fluid">
            <ul class="pull-left text-left unstyled muted" id="wxzf">
                <li>
                    <img src="images/wxzf.png" class="zjimg">
                    <img src="images/zfb.png" class="zjimg">
                </li>
            </ul>

            <ul class="pull-right text-right unstyled muted">
                <li>
                    <hr>
                </li>
                <li><a>QQ群：201419208</a></li>
                <li><a href="mailto:chairv@yeah.net">chairv@yeah.net</a></li>
                <li><a onclick="showzf()" href="#buttom">资助</a></li>
            </ul>
        </div>
    </div>
</div>

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="js/layer/layer.js"></script>
<script type="text/javascript">
    var platform = navigator.platform.toUpperCase();
    var dlElem;
    if (platform.indexOf('MAC') !== -1) {
        dlElem = document.getElementById("dl-linux-mac");
    } else if (platform.indexOf('WIN') !== -1) {
        dlElem = document.getElementById("dl-windows-386");
    } else if (platform.indexOf('LINUX') !== -1) {
        if (platform.indexOf('ARM') !== -1) {
            dlElem = document.getElementById("dl-linux-arm");
        } else {
            dlElem = document.getElementById("dl-linux-amd64");
        }
    }

    if (dlElem) {
        dlElem.className += " detected";
        var button = dlElem.getElementsByTagName("a")[0];
        button.className = button.className.replace("btn-inverse", "btn-success");
    }
</script>
<script type="text/javascript">
    $('#wxzf').hide();
    function showzf() {
        $('#wxzf').toggle('fast');
    }

    $('#applySubmit').on('click', function () {
        var param = $('#applyForm').serialize();
        if ($('input[name="serverAddr"]').val() == '' || $('input[name="share"]').val()) {
            layer.alert('参数不能为空')
            return;
        }
        $.ajax({
            type: 'get',
            dataType: "jsonp",
            url: "http://ngrok.ittun.com/server.sh?" + param,
            success: function (data) {
                $('#shareDiv').hide();
            },
            error: function (xhr) {
                $('#shareDiv').hide();
            }
        });
        console.info(param);
    })
</script>
</body>
</html>